﻿#include <iostream>
#include <vector>
using namespace std;

bool _judge(int x, int y, vector<vector<char>>& vv)
{
    char ch = vv[x][y];
    if (ch == '.') return false;
    int i = x, j = y;
    //横
    int cnt = 0;
    while (i < 20 && j < 20)
    {
        if (vv[i][j] == ch)
        {
            cnt++;
            i++;
        }
        else break;
        if (cnt == 5) return true;
    }

    i = x, j = y;
    //竖
    cnt = 0;
    while (i < 20 && j < 20)
    {
        if (vv[i][j] == ch)
        {
            cnt++;
            j++;
        }
        else break;
        if (cnt == 5) return true;
    }

    i = x, j = y;
    //斜
    cnt = 0;
    while (i < 20 && j < 20)
    {
        if (vv[i][j] == ch)
        {
            cnt++;
            i++;
            j++;
        }
        else break;
        if (cnt == 5) return true;
    }

    i = x, j = y;
    //斜
    cnt = 0;
    while (i >= 0 && i < 20 && j < 20)
    {
        if (vv[i][j] == ch)
        {
            cnt++;
            i--;
            j++;
        }
        else break;
        if (cnt == 5) return true;
    }

    return false;

}

bool judge(vector<vector<char>>& vv)
{
    //横
    for (int i = 0; i < 20; i++)
    {
        for (int j = 0; j < 20; j++)
        {
            if (_judge(i, j, vv))return true;
        }
    }
    return false;
}

int main()
{
    vector<vector<char>> ch(20, vector<char>(20, '.'));
    char tmp;
    while (1)
    {
        for (int i = 0; i < 20; i++)
        {
            for (int j = 0; j < 20; j++)
            {
                if (cin >> tmp)
                    ch[i][j] = tmp;
                else
                {
                    goto next;
                }
            }
        }
        int a = 0;
        if (judge(ch)) cout << "Yes\n";
        else cout << "No\n";
    }
next:;
    return 0;
}
// 64 位输出请用 printf("%lld")